﻿using System;
using System.Linq.Expressions;
using K9Nano.Application;

namespace K9Nano.IdentityServerCore.Roles.Dto
{
    public class RolePagedInputDto : PagedInputDto<Authentication.Role>
    {
        public string Role { get; set; }

        public string Api { get; set; }

        public string Resource { get; set; }

        public override Expression<Func<Authentication.Role, bool>> Predicate() =>
            string.IsNullOrEmpty(Role) ? (Expression<Func<Authentication.Role, bool>>)null : r => r.Name.Contains(Role);
    }
}